<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ include file="/WEB-INF/jsp/sys/css.jsp"%>
<html>
<head>
<%-- <link rel="stylesheet" href="${cp:SYS_VALUE('app.staticfile.home')}/vue/css/font-awesome.css"/> --%>
<link rel="stylesheet"
	href="${cp:SYS_VALUE('app.staticfile.home')}/vue/css/admin.css" />
</head>
<body>
	<style>
.welcome .layui-card {
	border: 1px solid #f2f2f2;
	border-radius: 5px;
}

.welcome .icon {
	margin-right: 10px;
	color: #1aa094;
}

.welcome .icon-cray {
	color: #ffb800 !important;
}

.welcome .icon-blue {
	color: #1e9fff !important;
}

.welcome .icon-tip {
	color: #ff5722 !important;
}

.welcome .layuimini-qiuck-module .child-module a {
	text-align: center;
	margin-top: 16px;
}

.welcome .layuimini-qiuck-module .child-module a h3 {
	padding-bottom: 10px;
	font-size: 12px;
}

.welcome .layuimini-qiuck-module .child-module a p cite {
	font-style: normal;
	font-size: 30px;
	font-weight: 300;
	color: #009688;
}

.welcome .layuimini-qiuck-module .child-module {
	display: inline-block;
	width: 100%;
	height: 100px;
	line-height: 60px;
	text-align: center;
	border-radius: 2px;
	font-size: 30px;
	background-color: #F8F8F8;
	color: #333;
	transition: all .3s;
	-webkit-transition: all .3s;
}

.welcome .layuimini-qiuck-module a i {
	display: inline-block;
	width: 100%;
	height: 100px;
	line-height: 60px;
	text-align: center;
	border-radius: 2px;
	font-size: 30px;
	background-color: #F8F8F8;
	color: #333;
	transition: all .3s;
	-webkit-transition: all .3s;
}

.welcome .layuimini-qiuck-module a cite {
	position: relative;
	top: 2px;
	display: block;
	color: #666;
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
	font-size: 14px;
}

.welcome .welcome-module {
	width: 100%;
	height: 210px;
}

.welcome .panel {
	background-color: #fff;
	border: 1px solid transparent;
	border-radius: 3px;
	-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .05)
}

.welcome .panel-body {
	padding: 10px
}

.welcome .panel-title {
	margin-top: 0;
	margin-bottom: 0;
	font-size: 12px;
	color: inherit
}

.welcome .label {
	display: inline;
	padding: .2em .6em .3em;
	font-size: 75%;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	text-align: center;
	white-space: nowrap;
	vertical-align: baseline;
	border-radius: .25em;
	margin-top: .3em;
}

.welcome .layui-red {
	color: red
}

.welcome .main_btn>p {
	height: 40px;
}

.welcome .layui-bg-number {
	background-color: #F8F8F8;
}

.welcome .layuimini-notice:hover {
	background: #f6f6f6;
}

.welcome .layuimini-notice {
	padding: 7px 16px;
	clear: both;
	font-size: 12px !important;
	cursor: pointer;
	position: relative;
	transition: background 0.2s ease-in-out;
}

.welcome .layuimini-notice-title, .layuimini-notice-label {
	padding-right: 70px !important;
	text-overflow: ellipsis !important;
	overflow: hidden !important;
	white-space: nowrap !important;
}

.welcome .layuimini-notice-title {
	line-height: 28px;
	font-size: 14px;
	width: 340px;
}

.welcome .layuimini-notice-extra {
	position: absolute;
	top: 50%;
	margin-top: -8px;
	right: 16px;
	display: inline-block;
	height: 16px;
	color: #999;
}

.layadmin-pagetabs .layui-tab-title li.layui-this {
	background-color: #f6f6f6;
}

.layadmin-pagetabs .layui-tab-title li.layui-this:after {
	width: 100%;
	border: none;
	height: 2px;
	background-color: #292B34;
}
/* 待办事项 */
.db-content {
	width: 440px;
	height: 92%;
	position: absolute;
	left: 80px;
}

.align-center {
	width: 50px;
	height: 91%;
	position: absolute;
	overflow-x: hidden;
	border-radius: 3px;
	border: 2px solid #e2e2e2;
}

.layui-nav-ul {
	position: relative;
	padding: 0;
	width: 50px;
}

.layui-nav-ul li:first-child {
	border-bottom-style: ridge;
}

.layui-nav-ul li {
	display: block;
	line-height: 120px;
	text-align: center;
	width: 100%;
}

.layui-nav-li {
	
}

.layui-nav-ul li span {
	float: right;
	padding-right: 6px;
	margin-top: 30px;
	margin-right: 2px;
}

.layui-col-xs3 {
	width: 50%;
	height: 50%;
}

.headCard {
	height: 100px
}

.layui-col-md3 {
	width: 22%;
}

.layui-col-md4 {
	width: 33%;
}

.incard1 {
	width: 100%;
	height: 100%;
	text-align: right;
	float: left;
}

.incard2 {
	float: left;
	/* position: relative;
	top: 50%;
	transform: translateY(-50%); */
	width: 25%;
	height: 65%;
	/* margin-left: 30%; */
}

.incard3 {
	font-weight: bolder;
	position: relative;
	top: 50%;
	transform: translateY(-50%);
	float: right;
	right: 5%;
	color: #fff;
}

.incard4 {
	font-size: 44px;
}

.incard5 {
	width: 0px;
	border: 1px solid #E5E5E5;
	float: left;
	height: 50%;
	position: relative;
	top: 50%;
	transform: translateY(-50%);
}

.incard6 {
	float: left;
	font-size: 20px;
	font-weight: bolder;
	text-align: center; 
	width: 49%;
	height: 100%;
}


.incard8{
	width: 100%;
    height: 60%;
    position: relative;
    top: 30%;
    transform: translateY(-50%);
}
.layui-table-view {
	border-width: 0px;
}

.layui-table td, .layui-table th {
	border-style: none !important;
}

.layui-table thead tr {
	background-color: #F8F8F8
}

.layui-table[lay-even] tr:nth-child(even) {
	background-color: #fff;
}

/* .layui-table-view{
	height: 100%;
} */

/* .layui-table-view{
	height: 100%;
}
.layui-table-box {
	height: 85%;
} */
</style>
	<div class="layuimini-container layui-anim layui-anim-upbit"
		style="width: 96.7%; margin-top: 10px; margin-left: 20px;height: 93%;">
		<input type="hidden" id="transContents" name="transContents" />
		<div class="layuimini-main welcome">
			<!-- 上面的那几个展示按钮 -->
			<div class="layui-col-md12">
				<div class="layui-row layui-col-space30">
					<div class="layui-col-md3">
						<div class="layui-card headCard">
							<div class="incard1" style="cursor: pointer;background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/jhjf.png') center no-repeat;background-size: 100% 100%;" onclick="openYY(1)">
								<div class="incard3">
									<span class="incard4" style="color: #fff" id="jhjf">0</span>
									<br> 计划交付
								</div>
							</div>
						</div>
					</div>
					<div class="layui-col-md3">
						<div class="layui-card headCard">
							<div class="incard1" style="cursor: pointer;background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/sjyy.png') center no-repeat;background-size: 100% 100%;" onclick="openYY(2)">
								<div class="incard3">
									<span class="incard4" style="color: #Fff" id="sjyy">0</span>
									<br> 实际运营
								</div>
							</div>
						</div>
					</div>

					<div class="layui-col-md3">
						<div class="layui-card headCard">
							<div class="incard1" style="cursor: pointer;background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/tcyy.png') center no-repeat;background-size: 100% 100%;" onclick="openYY(3)">
								<div class="incard3">
									<span class="incard4" style="color: #fff" id="tcyy">0</span>
									<br> 退出运营
								</div>
							</div>
						</div>
					</div>
					<div class="layui-col-md4">
						<div class="layui-card headCard"
							style="cursor: pointer;">
							<div class="incard6" onclick="openGH(1)">
							<div class="incard8" style="background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/qigh.png') center no-repeat;">
								</div>
								<span class="incard7" style="color: #3B3B3B;">公司远期规划
								</span>
							</div>
							<div class="incard5"></div>
							<div class="incard6" onclick="openGH(2)">
							<div class="incard8" style="background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/ndfj.png') center no-repeat;">
								</div>
								<span class="incard7" style="color: #3B3B3B;">年度飞机引进计划
								</span>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- 中间的表格部分 -->
			<%--<div class="layui-col-md12" style="margin-top: 20px; ">
				<div class="layui-card" style="width: 99%;">
					<div class="layui-card-header">
					<div style="width: 280px;height: 100%;background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/textpng.png') center no-repeat;    background-size: 100% 80%;float: left;">
						<div style="float:left;color: #fff; font-size: 18px;letter-spacing:2px;margin-left: 20%">
						我的待办
						</div>
						</div>
					<div style="width: 50px;height: 50px;float:right;background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/fj.png') center no-repeat;background-size: 60% 50%;"></div>
					</div>
					<div class="layui-card-body" >
						<table class="layui-hide" id="demo" lay-filter="demo"></table>
					</div>
				</div>
			</div>--%>


			<div class="layui-col-md12" id="jhdxyjDiv" style="margin-top: 15px; ">
				<div class="layui-card" style="width: 99%;">
					<div class="layui-card-header">
						<div style="width: 280px;height: 100%;background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/textpng.png') center no-repeat;    background-size: 100% 80%;float: left;">
							<div style="float:left;color: #fff; font-size: 18px;letter-spacing:2px;margin-left: 20%" id="tableName2">
								计划大修预警
							</div>
						</div>
						<div style="width: 50px;height: 50px;float:right;background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/fj.png') center no-repeat;background-size: 60% 50%;"></div>
					</div>
					<div class="layui-card-body" >
						<table class="layui-hide" id="dtzzdqjk2" lay-filter="dtzzdqjk2" style="height: 100%"></table>
					</div>
				</div>
			</div>

			<div class="layui-col-md12" id="yqdxyjDiv" style="margin-top: 15px; ">
				<div class="layui-card" style="width: 99%;">
					<div class="layui-card-header">
						<div style="width: 280px;height: 100%;background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/textpng.png') center no-repeat;    background-size: 100% 80%;float: left;">
							<div style="float:left;color: #fff; font-size: 18px;letter-spacing:2px;margin-left: 20%" id="tableName3">
								预期大修预警
							</div>
						</div>
						<div style="width: 50px;height: 50px;float:right;background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/fj.png') center no-repeat;background-size: 60% 50%;"></div>
					</div>
					<div class="layui-card-body" >
						<table class="layui-hide" id="dtzzdqjk3" lay-filter="dtzzdqjk3" style="height: 100%"></table>
					</div>
				</div>
			</div>

			<!-- 下面的表格部分 -->
			<div class="layui-col-md12" id="dtzzdqjkDiv" style="margin-top: 15px; ">
				<div class="layui-card" style="width: 99%;">
					<div class="layui-card-header">
						<div style="width: 280px;height: 100%;background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/textpng.png') center no-repeat;    background-size: 100% 80%;float: left;">
							<div style="float:left;color: #fff; font-size: 18px;letter-spacing:2px;margin-left: 20%" id="tableName">
								电台执照到期监控
							</div>
						</div>
						<div style="width: 50px;height: 50px;float:right;background: url('${cp:SYS_VALUE('app.staticfile.home')}/vue/images/fj.png') center no-repeat;background-size: 60% 50%;"></div>
					</div>
					<div class="layui-card-body" >
						<table class="layui-hide" id="dtzzdqjk" lay-filter="dtzzdqjk" style="height: 100%"></table>
					</div>
				</div>
			</div>

		</div>
		
	</div>
	<div>	<div class="layui-footer footer"
			style="text-align: center; color: #2B58AD">
			<p>
				Copyright 2020  中国东方航空江苏有限公司版权所有 <br> 技术支持：中国东方航空江苏有限公司信息部
			</p>
		</div>
		</div>
	<script type="text/javascript">
		var basePath = "${pageContext.request.contextPath}";
		var userRolePower = "${sessionScope.userRolePower}";
		console.log("---userRolePower---"+userRolePower);
		var apprflowpath = "${cp:SYS_VALUE('nginxpath')}" + '/apprFlow';
		switch (userRolePower) {
			case "allAdmin":
				$("#jhdxyjDiv").show();
				$("#yqdxyjDiv").show();
				$("#dtzzdqjkDiv").show();
				break;
			case "szAdmin":
				$("#jhdxyjDiv").hide();
				$("#yqdxyjDiv").hide();
				$("#dtzzdqjkDiv").show();
				break;
			case "dxAdmin":
				$("#jhdxyjDiv").show();
				$("#yqdxyjDiv").show();
				$("#dtzzdqjkDiv").hide();
				break;
			default:
				$("#jhdxyjDiv").hide();
				$("#yqdxyjDiv").hide();
				$("#dtzzdqjkDiv").hide();
				break;
		}

		
		var primaryUnit = '${sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.userInfo.primaryUnit}';
		var userInfo = '${sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.userInfo}';
		console.log("---userInfo---"+JSON.stringify(userInfo))
		var tableName = '';
		var type = 0;
		var jksxId = '';
		/*if(primaryUnit == '12' || primaryUnit == '10'){*/
		if(false){
			tableName = '合同到期监控';
			type = 0
			jksxId='22cf64f0983b4eafbdbce3e039b0f86b';
		} else {
			tableName = '电台执照到期监控';
			jksxId='76143c2e0eb74191ad4e6f486fa2ad0d';
			if(primaryUnit == '11'){
				type = 1;
			} else {
				type = 2;
			}
		}
		$("#tableName").html(tableName);
		var tableColList = [
			[ //标题栏
				{
					type : 'numbers',
					title : '序号',
					width : '5%'
				}, {
					field : 'airModel',
					title : '航空器型号和制造人',
					width : '20%',
					align : 'center'
				}, {
					field : 'sign', 
					title : '国籍标志和登记标志',
					width : '20%',
					align : 'center'
				}, {
					field : 'nature',
					title : '飞机性质',
					width : '13%',
					align : 'center'
				},{
					field : 'endTime',
					title : '到期时间',
					width : '15%',
					templet:'#dateForMat2',
					align : 'center'
				}, {
					field : 'syday',
					title : '剩余时间(天)',
					width : '15%',
					align : 'center',
					templet:'#dayFormat'
				}, {
					fixed : 'right',
					title : '操作',
					width : '12%',
					align : 'center',
					toolbar : '#dtzzdqjk_bar'
				} ] ,
				[ //标题栏
					{
						type : 'numbers',
						title : '序号',
						width : '5%'
					}, {
						field : 'airModel',
						title : '航空器型号和制造人',
						width : '15%',
						align : 'center'
					}, {
						field : 'sign',
						title : '国籍标志和登记标志',
						width : '15%',
						align : 'center'
					}, {
						field : 'nature',
						title : '飞机性质',
						width : '13%',
						align : 'center'
					}, {
						field : 'dtNo',
						title : '电台执照序号',
						width : '15%',
						align : 'center'
					}, {
						field : 'dtyxDate',
						title : '电台执照有效期限',
						width : '15%',
						templet:'#dateForMat', 
						align : 'center'
					}, {
						field : 'dtzzDqsj',
						title : '剩余时间(天)',
						width : '10%',
						align : 'center',
						templet:'#dayFormat'
					}, {
						fixed : 'right',
						title : '操作',
						width : '12%',
						align : 'center',
						toolbar : '#dtzzdqjk_bar'
					} ] ,
					[ //标题栏
						{
							type : 'numbers',
							title : '序号',
							width : '5%'
						}, {
							field : 'airModel',
							title : '航空器型号和制造人',
							width : '20%',
							align : 'center'
						}, {
							field : 'sign',
							title : '国籍标志和登记标志',
							width : '15%',
							align : 'center'
						},{
							field : 'dtNo',
							title : '电台执照序号',
							width : '10%',
							align : 'center'
						}, {
							field : 'dtyxDate',
							title : '电台执照有效期限',
							width : '15%',
							templet:'#dateForMat',
							align : 'center'
						}, {
						field : 'dtzzjkbjDate',
						title : '电台执照监控报警日期',
						width : '15%',
						align : 'center'
					},  {
							field : 'dtzzDqsj',
							title : '超过预警时间(天)',
							width : '10%',
							align : 'center',
							/*templet:'#dayFormat'*/
						sort:true
						},{
						fixed : 'right',
						width : '10%',
						title : '操作',
						align : 'center',
						toolbar : '#operator_bar_view',
						event : 'setSign'
					}],
			[ //标题栏
				{
					type : 'numbers',
					title : '序号',
					width : '5%'
				}, {
				field : 'airModel',
				title : '航空器型号和制造人',
				width : '20%',
				align : 'center'
			}, {
				field : 'sign',
				title : '国籍标志和登记标志',
				width : '15%',
				align : 'center'
			}, {
				field : 'nature',
				title : '飞机性质',
				width : '10%',
				align : 'center'
			}, {
				field : 'endTime',
				title : '退租时间',
				width : '15%',
				align : 'center'
			}, {
				field : 'jhdxxyckssjT',
				title : '机身计划大修下一次开始时间T',
				width : '15%',
				templet:'#dateForMat',
				align : 'center'
			}, {
				field : 'tzrqqbnnjhdxDays',
				title : '剩余时间(天)',
				width : '10%',
				align : 'center',
				sort:true
			},
				{
				fixed : 'right',
				width : '10%',
				title : '操作',
				align : 'center',
				toolbar : '#operator_bar_view',
				event : 'setSign'
			}],
			[ //标题栏
				{
					type : 'numbers',
					title : '序号',
					width : '5%'
				}, {
				field : 'airModel',
				title : '航空器型号和制造人',
				width : '20%',
				align : 'center'
			}, {
				field : 'sign',
				title : '国籍标志和登记标志',
				width : '15%',
				align : 'center'
			}, {
				field : 'nature',
				title : '飞机性质',
				width : '10%',
				align : 'center'
			}, {
				field : 'endTime',
				title : '退租时间',
				width : '15%',
				align : 'center'
			}, {
				field : 'dxksslQ1',
				title : '机身预期下一次大修开始时间Q1',
				width : '15%',
				templet:'#dateForMat',
				align : 'center'
			}, {
				field : 'tzrqqbnnyqdxDays',
				title : '剩余时间(天)',
				width : '10%',
				align : 'center',
			},
				{
					fixed : 'right',
					width : '10%',
					title : '操作',
					align : 'center',
					toolbar : '#operator_bar_view',
					event : 'setSign'
				}]
			
		]
		
		
		$.ajax({
			url : basePath + "/service/cxtj/homePageTopNum",
			type : "GET",
			success : function(data) {
				if (data.length > 0) {
					$("#jhjf").html(data[0].jhjf);
					$("#sjyy").html(data[0].sjyy);
					$("#tcyy").html(data[0].tcyy);
				}
			}
		})

		layui
				.config({
					base : "/dhjdglxt/modules/util/"//自定义加载的模块
				})
				.use(
						[ 'form', 'layer', 'jquery', 'layedit', 'laydate',
								'laypage', 'table', 'commUtil', 'element' ],
						function() {
							var form = layui.form, layer = parent.layer === undefined ? layui.layer
									: parent.layer, laypage = layui.laypage, layedit = layui.layedit, laydate = layui.laydate, $ = layui.jquery;
							var table = layui.table;
							var commUtil = layui.commUtil;
							var element = layui.element;
							var taskUrl = basePath
									+ '/service/airplanebaseinfo/airplanebaseinfo/listDb'
							table.render({
								elem : '#demo',
								cols : [ [ {
									type : 'numbers',
									title : '序号',
									width : '5%',
									event : 'setSign'
								},{field:'ideaType', width:'13%', title: '待办类别', align: 'center',event:'setSign'}, {
									field : 'ghName',
									title : '引进计划',
									sort : true,
									align : 'center',
									event : 'setSign'
								}, {
									field : 'unitName',
									width : '14%',
									title : '主办部门',
									sort : true,
									align : 'center',
									templet : 'formatUnitCode',
									event : 'setSign'
								}, {
									field : 'createTime',
									width : '17%',
									title : '更新时间',
									sort : true,
									align : 'center',
									event : 'setSign'
								}, {
									fixed : 'right',
									width : '17%',
									title : '操作',
									align : 'center',
									toolbar : '#operator_bar',
									event : 'setSign'
								}

								] ],
								skin : 'line' //表格风格
								,
								even : true
								//,page: true //是否显示分页
								,
								limits : [ 5, 50, 100 ],
								limit : 5 //每页默认显示的数量
								,
								url : taskUrl
							});

							table
									.render({
										elem : '#dtzzdqjk',
										cols : [ tableColList[type] ],
										url : basePath
												/*+ "/service/dtjktxlog/jddtdtjktxlog?clStatus=1&jksxId="+jksxId,*/
												/*+ "/service/airplanebaseinfo/airplanebaseinfo/listForYj?dtzzDq=dtzz&jksxId="+jksxId,*/
												+ "/service/airplanebaseinfo/airplanebaseinfo/listForYj2?searchType=dtzz",
										skin : 'line' //表格风格
										,
										even : true,
										page : true //是否显示分页
										,
										limits : [ 5, 50, 100 ],
										limit : 5
									//每页默认显示的数量
									});
							/*---------------------------*/
							table
									.render({
										elem : '#dtzzdqjk2',
										cols : [ tableColList[3] ],
										url : basePath
												/*+ "/service/airplanebaseinfo/airplanebaseinfo/listForYj?clStatus=1&jksxId="+jksxId,*/
											+ "/service/airplanebaseinfo/airplanebaseinfo/listForYj2?searchType=jhdx",
										skin : 'line' //表格风格
										,
										even : true,
										page : true //是否显示分页
										,
										limits : [ 5, 50, 100 ],
										limit : 5
										//每页默认显示的数量
									});
							table
									.render({
										elem : '#dtzzdqjk3',
										cols : [ tableColList[4] ],
										url : basePath
												/*+ "/service/airplanebaseinfo/airplanebaseinfo/listForYj?clStatus=1&jksxId="+jksxId,*/
												+ "/service/airplanebaseinfo/airplanebaseinfo/listForYj2?searchType=yqdx",
										skin : 'line' //表格风格
										,
										even : true,
										page : true //是否显示分页
										,
										limits : [ 5, 50, 100 ],
										limit : 5,
										//每页默认显示的数量
										done: function (res, curr, count) {
											// layer.close(load);
											//如果是异步请求数据方式，res即为你接口返回的信息。
											//如果是直接赋值的方式，res即为：{data: [], count: 99} data为当前页数据、count为数据总长度
											console.log(res);
											//得到当前页码
											console.log(curr);
											//得到数据总量
											console.log(count);
											// 根据条件判断加背景色
											$.each(res.data, function (index, item) {
												// console.log("----index---"+index)
												// console.log("----item---"+JSON.stringify(item))
												if (item.tzrqqbnnjhdx=='预警') {
													// 法1
													// $("#table-id").next().find('tbody tr[data-index="' + index +
													// 		'"]').css("background-color", "#FFA07A");
													// 法2
													// var i = index + 1;
													// $('tr').eq(i).css("background-color", "#FF5722");
													// 法3
													// $('#yqdxyjDiv .layui-table').find('tr[data-index="' + index + '"]').css('background-color', "#FF5722");
												}
											});
										}
									});

							table.on('tool(dtzzdqjk)', function(obj) {
								var data = obj.data;
								console.log(data);
								if (obj.event === 'view') {
									onbg(data);
								}
							});
							//变更
							function onbg(data) {
								var index = layui.layer
										.open({
											title : "变更",
											type : 2,
											skin : 'layui-layer-molv',
											area : [ '1000px', '400px' ],
											offset : 't',
											content : basePath
													+ '/service/airplanebaseinfo/airplanebaseinfo/'
													+ data.airId + "/bg?logId="
													+ data.recId,
											success : function(layero, index) {
												commUtil.resizeLayer(index,
														'400');
											}
										});
							}
							//监听工具条
							table.on('tool(demo)', function(obj) {
								var data = obj.data;
								if (obj.event === 'optLink') {
									optLink( data)
								}

							});

							table.on('tool(dtzzdqjk)', function(obj) {
								var data = obj.data;
								if (obj.event === 'optLinkView') {
									onView(data.recId)
								}else if(obj.event === 'optLinkStopSms'){
									//alert("电台执照关闭短信");
									$.ajax({
										url: basePath + "/service/airplanebaseinfo/airplanebaseinfo/closeSms/{recId}",
										type: "PUT",
										data: {
											"closeSmsDtzz":"D"
										},
										dataType:"json",
										contentType : 'application/json;charset=utf-8', //设置请求头信息
										success: function (result) {
											if (result.code == 0) {
												layer.msg("保存成功",{icon:0});

											} else {
												layer.msg(result.msg, {icon: 2})
											}
										}
									});

								}

							});
							table.on('tool(dtzzdqjk2)', function(obj) {
								var data = obj.data;
								if (obj.event === 'optLinkView') {
									onView(data.recId)
								}else if(obj.event === 'optLinkStopSms'){
									alert("计划大修关闭短信")

								}

							});
							table.on('tool(dtzzdqjk3)', function(obj) {
								var data = obj.data;
								if (obj.event === 'optLinkView') {
									onView(data.recId)
								}else if(obj.event === 'optLinkStopSms'){
									alert("预期大修关闭短信")

								}

							});
							//查看
							function onView(recId,data){
								var index = layui.layer.open({
									title : "查看",
									type : 2,
									skin:'layui-layer-molv',
									area:['100%','100%'],
									offset: 't',
									content : basePath + '/service/airplanebaseinfo/airplanebaseinfo/'+recId+"/view",
									success : function(layero, index){
										setTimeout(function(){
											layer.style(index, {
												top: 0,
												height: window.innerHeight
											});
										},100);
									}
								});
								//layui.layer.full(index);
							}

							//办理
							function optLink(data) {
								$("#transContents").val("");
								  var index = layui.layer.open({
						              title : "编辑",
						              type : 2,
						              skin:'layui-layer-molv',
						              area:['100%','100%'],
						              offset: 't',
						              content : basePath + '/service/airplanebaseinfo/airplanebaseinfo/'+data.recId+"/openDb",
						              success : function(layero, index){
						                  setTimeout(function(){
						                      layer.style(index, {
						                          top: 0,
						                          height: window.innerHeight
						                      });
						                  },100);
						              }
						          });
						          //layui.layer.full(index);
							}
						})
	</script>
	<script type="text/html" id="operator_bar">
		<a class="seelct" style="color:#1e9fff;cursor:pointer" lay-event="optLink">办理</a>
		</script>

	<script type="text/html" id="dtzzdqjk_bar">
    	<a class="see" lay-event="view">变更</a>
    </script>

	<script type="text/html" id="operator_bar_view">
		<a class="seelct" style="color:#1e9fff;cursor:pointer" lay-event="optLinkView">查看</a>
		<a class="seelct" style="color:#1e9fff;cursor:pointer" lay-event="optLinkStopSms">关闭短信</a>
	</script>
<script type="text/html" id="dateForMat">
 {{timeStr(d.dtyxDate)}}
   
</script>
<script type="text/html" id="dateForMat2">
 {{timeStr(d.dqDate)}}
   
</script>
<script type="text/html" id="dayFormat">

{{# if(d.syday<=d.alarmR){    }}
	<span style="color:red;"> {{d.syday}}</span>
{{# }else if(d.syday<=d.alarmY){  }}
	<span style="color:#ffb800;"> {{d.syday}}</span>
{{# }else{ }}
	<span >  {{d.syday}}</span>
{{# } }}

   
</script>


	<script type="text/javascript">
	function timeStr(str) {
	    if (str != null && str != undefined && str != "undefined" && str != "") {
	        return str.substr(0, 10);
	    } else {
	        return "";
	    }

	}
		function openGH(type) {
			var title = '';
			if (type == 1) {
				title = '公司远期规划';
			}
			if (type == 2) {
				title = '年度飞机引进计划';
			}
			var index = layui.layer.open({
				title : title,
				type : 2,
				skin : 'layui-layer-molv',
				area : [ '90%', '90%' ],
				offset : 't',
				content : basePath
						+ '/modules/jdghgl/jdghgl/jdghglHomepage.jsp?type='
						+ type,
				success : function(layero, index) {

				}
			});
		}

		function openYY(status) {
			var title = '';
			if (status == 1) {
				title = '计划交付';
			}
			if (status == 2) {
				title = '实际运营';
			}
			if (status == 3) {
				title = '退出运营';
			}
			var index = layui.layer
					.open({
						title : title,
						type : 2,
						skin : 'layui-layer-molv',
						area : [ '100%', '100%' ],
						offset : 't',
						content : basePath
								+ '/modules/airplanebaseinfo/airplanebaseinfo/airplanebaseinfoHomePage.jsp?status='
								+ status,
						success : function(layero, index) {

						}
					});
		}
	</script>
</body>
</html>
